import { industryList, shop_xxx } from '../../api/shopList'
export default {
  namespaced: true,
  state: {
    isXQ: false,
    isName: true,
    formDelivery: {},
    formInput: {},
    fromAggregate: {},
    // 行业
    hanye: [],
    // 用户信息
    userList: {}
  },
  mutations: {
    // 基础信息
    fromValue(state, value) {
      state.formDelivery = value
    },

    deconstruction(state) {
      state.fromAggregate = {}
      state.fromAggregate = { ...state.formDelivery, ...state.formInput }
    },
    flageName(state, value) {
      state.isName = value
    },
    Pathhanye(state, value) {
      state.hanye = value
    },
    user(state, value) {
      state.userList = value
    },
    gaiIsXQ(state, value) {
      state.isXQ = value
    }
  },
  actions: {
    pathIndustry(context) {
      industryList().then(res => {
        context.commit('Pathhanye', res.data)
      })
    },
    pathUser(context, value) {
      shop_xxx(value).then((res) => {
        context.commit('user', res.data)
      })
    }
  }
}
